<?php
//站点模型
class WebsiteModel extends CommonModel {
	
	/**
	 * 站点列表
	 * @param string $siteName 站点名称关键字
	 */
	public function getWebsite($siteName='')
	{
		$where = $webList = $page = '';
		if($siteName) $where = " website_name like '%{$siteName}%'";
		$count = $this->where($where)->count();
		if($count > 0)
		{
			import("@.ORG.Page");
			$p = new Page($count,10);
			$where = $where ? ' where '.$where : '';
			$sql="select 
						web.*,user.sysuser_name as create_uname
				  from 
				  		douhao_website as web  
				  left join
				  		douhao_sysuser as `user`
				  on    
				        web.create_user = user.id
				  $where
				  limit $p->firstRow , $p->listRows
			";
		    $webList = $this->query($sql); 
		    $page = $p->show();
		}	
		return array('list'=>$webList,'page'=>$page);
	}
}
?>